
from sync_web.models import BucketSyncBaseInfo, AsyncTask


# 根据数据库信息配置settings

def sync_web_settings_set():
    try:
        obj = BucketSyncBaseInfo.objects.all()
        if not obj:
            return
        for u in obj:
            u.sync_status = 0
            u.dir_flag = True
            u.save(update_fields=['sync_status', 'dir_flag'])

        obj = AsyncTask.objects.all()
        if not obj:
            return

        for i in obj:
            i.delete()
    except Exception as e:
        pass